import Vue from "vue";
import VueRouter from "vue-router";
import MainPage from "@/pages/MainPage.vue";
import LoginPage from "@/pages/LoginPage.vue";
import HmMine from "@/views/HmMine.vue";
import HmInterview from "@/views/HmInterview.vue";
import HmKeep from "@/views/HmKeep.vue";
import HmLike from "@/views/HmLike.vue";
import HmRecommend from "@/views/HmRecommend.vue";
import HmLatest from "@/views/HmLatest.vue";
import ViewDatils from "@/pages/ViewDatils.vue";

Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    { path: "/", redirect: "/login" },
    { path: "/login", component: LoginPage },
    {
      path: "/main",
      component: MainPage,
      children: [
        { path: "/main/mine", component: HmMine },
        {
          path: "/main/interview",
          component: HmInterview,
          children: [
            {
              path: "/main/interview/recommend",
              component: HmRecommend,
            },
            { path: "/main/interview/latest", component: HmLatest },
          ],
        },
        { path: "/main/keep", component: HmKeep },
        { path: "/main/like", component: HmLike },
      ],
    },
    { path: "/viewdetails/:id", component: ViewDatils },
  ],
  //   mode: "history",
  linkActiveClass: "active",
  linkExactActiveClass: "active",
});

export default router;
